﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
	mc:Ignorable="d"
	x:Class="MVVM_CAD.OpenFileDialog"
	x:Name="UserControl"
	d:DesignWidth="261.377" d:DesignHeight="126" Width="262" Height="126">
	
	<UserControl.DataContext>
        <Binding Path="Main.SceneManagerViewModel" Source="{StaticResource Locator}"/>
    </UserControl.DataContext>
	
	<UserControl.Resources>
		<Style x:Key="ToolButton" TargetType="{x:Type Button}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<Grid>
							<i:Interaction.Triggers>
								<i:EventTrigger EventName="MouseLeave">
									<ei:GoToStateAction x:Name="OnMouseLeaveForButton" StateName="OnMouseLeave"/>
								</i:EventTrigger>
								<i:EventTrigger EventName="MouseEnter">
									<ei:GoToStateAction x:Name="OnMouseEnterForButton" StateName="OnMouseOver"/>
								</i:EventTrigger>
							</i:Interaction.Triggers>
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="ButtonMouseOver">
									<VisualStateGroup.Transitions>
										<VisualTransition GeneratedDuration="0:0:0.2"/>
									</VisualStateGroup.Transitions>
									<VisualState x:Name="OnMouseLeave">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="rectangle">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
											</ObjectAnimationUsingKeyFrames>
											<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rectangle">
												<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
											</DoubleAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="OnMouseOver">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="rectangle">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
											</ObjectAnimationUsingKeyFrames>
											<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rectangle">
												<EasingDoubleKeyFrame KeyTime="0" Value="0.275"/>
											</DoubleAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Rectangle Fill="#FF838383" RadiusY="5" RadiusX="5" Stroke="#FF6C6C6C"/>
							<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
							<Rectangle x:Name="rectangle" RadiusY="5" RadiusX="5" Stroke="#FF6C6C6C" Opacity="0" Visibility="Visible">
								<Rectangle.Fill>
									<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
										<GradientStop Color="Black" Offset="0.151"/>
										<GradientStop Color="White" Offset="1"/>
										<GradientStop Color="White" Offset="1"/>
									</LinearGradientBrush>
								</Rectangle.Fill>
							</Rectangle>
						</Grid>
						<ControlTemplate.Triggers>
							<Trigger Property="IsFocused" Value="True"/>
							<Trigger Property="IsDefaulted" Value="True"/>
							<Trigger Property="IsMouseOver" Value="True"/>
							<Trigger Property="IsPressed" Value="True"/>
							<Trigger Property="IsEnabled" Value="False"/>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</UserControl.Resources>

	<Grid x:Name="LayoutRoot">
		<VisualStateManager.VisualStateGroups>
			<VisualStateGroup x:Name="Display">
				<VisualStateGroup.Transitions>
					<VisualTransition GeneratedDuration="0:0:0.5">
						<VisualTransition.GeneratedEasingFunction>
							<ExponentialEase EasingMode="EaseIn"/>
						</VisualTransition.GeneratedEasingFunction>
					</VisualTransition>
				</VisualStateGroup.Transitions>
				<VisualState x:Name="DisplayOn"/>
				<VisualState x:Name="DisplayOff">
					<Storyboard>
						<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="UserControl">
							<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
							<DiscreteObjectKeyFrame KeyTime="0:0:0.4" Value="{x:Static Visibility.Hidden}"/>
						</ObjectAnimationUsingKeyFrames>
						<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="UserControl">
							<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
						</DoubleAnimationUsingKeyFrames>
					</Storyboard>
				</VisualState>
			</VisualStateGroup>
		</VisualStateManager.VisualStateGroups>
		<Grid>
			<i:Interaction.Triggers>
				<ei:DataStoreChangedTrigger Binding="{Binding HardCoded2}">
					<ei:GoToStateAction x:Name="DisplayOn1" StateName="DisplayOn"/>
				</ei:DataStoreChangedTrigger>
				<i:EventTrigger>
					<ei:GoToStateAction x:Name="DisplayOff1" StateName="DisplayOff"/>
				</i:EventTrigger>
			</i:Interaction.Triggers>
			<Rectangle Fill="#FF3D3D3D" RadiusY="5" RadiusX="5" Stroke="#FF959595" StrokeThickness="5" Margin="0,20,1.377,0"/>
			<Label Content="Archivo" Width="65.333" Foreground="#FFCFCBCB" HorizontalAlignment="Left" Margin="14.334,40.34,0,62.327"/>
			<Button Content="Abrir" Style="{DynamicResource ToolButton}" Command="{Binding OpenToFileToolCommand, Mode=OneWay}" Height="27.333" Margin="94.321,0,96.968,14.889" VerticalAlignment="Bottom" CommandParameter="{Binding SelectedItem, ElementName=comboBox}"/>
			<Label Content="Cerrar" Height="25" Width="44" Foreground="#FFABA6A6" FontSize="9.333" HorizontalAlignment="Right" Margin="0,0,0,0.477" VerticalAlignment="Bottom">
				<i:Interaction.Triggers>
					<i:EventTrigger EventName="MouseLeftButtonDown">
						<ei:GoToStateAction x:Name="CloseProperties" StateName="DisplayOff"/>
					</i:EventTrigger>
				</i:Interaction.Triggers>
			</Label>
			<ComboBox x:Name="comboBox" Margin="67,41,16,62" ItemsSource="{Binding FilesLoaded}"/>
		</Grid>
	</Grid>
</UserControl>